package com.example.ccxmt.my_hot_news;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

//custom content
import android.view.View;
import android.widget.Button;
import android.webkit.WebView;


public class MainActivity extends AppCompatActivity {
//custom content
    Button btn1,btn2,btn3,btn4,btn5;
    WebView WV1,WV2,WV3,WV4,WV5;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //custom content
        WV1=(WebView) findViewById(R.id.webview1);
        WV1.getSettings().setJavaScriptEnabled(true);
        WV1.loadUrl("https://3g.163.com/touch/#/");

        WV2=(WebView) findViewById(R.id.webview2);
        WV2.getSettings().setJavaScriptEnabled(true);
        WV2.loadUrl("https://m.so.com/s?q=热点");

        WV3=(WebView) findViewById(R.id.webview3);
        WV3.getSettings().setJavaScriptEnabled(true);
        WV3.loadUrl("https://m.sogou.com/web/searchList.jsp?keyword=热点");

        WV4=(WebView) findViewById(R.id.webview4);
        WV4.getSettings().setJavaScriptEnabled(true);
        WV4.loadUrl("https://is.snssdk.com/2/wap/search/extra/hot_word_list/");

        WV5=(WebView) findViewById(R.id.webview5);
        WV5.getSettings().setJavaScriptEnabled(true);
        WV5.loadUrl("https://m.weibo.cn/p/index?containerid=106003type%3D25%26t%3D3%26disable_hot%3D1%26filter_type%3Drealtimehot");

        btn1=(Button) findViewById(R.id.button1);
        btn1.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                WV1.setVisibility(View.VISIBLE);
            }
        });

        btn2=(Button) findViewById(R.id.button2);
        btn2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                WV1.setVisibility(View.GONE);
                WV2.setVisibility(View.VISIBLE);
            }
        });

        btn3=(Button) findViewById(R.id.button3);
        btn3.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                WV1.setVisibility(View.GONE);
                WV2.setVisibility(View.GONE);
                WV3.setVisibility(View.VISIBLE);
            }
        });

        btn4=(Button) findViewById(R.id.button4);
        btn4.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                WV1.setVisibility(View.GONE);
                WV2.setVisibility(View.GONE);
                WV3.setVisibility(View.GONE);
                WV4.setVisibility(View.VISIBLE);
            }
        });

        btn5=(Button) findViewById(R.id.button5);
        btn5.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                WV1.setVisibility(View.GONE);
                WV2.setVisibility(View.GONE);
                WV3.setVisibility(View.GONE);
                WV4.setVisibility(View.GONE);
                WV5.setVisibility(View.VISIBLE);
            }
        });


    }

}
